// src/router/index.js
import { createBrowserRouter, createRoutesFromElements, Route } from 'react-router-dom'
import Home from '../views/HomeView/HomeView'
import Contact from '../views/ContactView/ContactView'
import Login from '../views/LoginView/LoginView'
import HomePage from '../views/HomePage/HomePage'
import About from '../views/AboutView/AboutView'
import CAbout from '../views/CAboutView/CAboutView'

const router = createBrowserRouter(
    createRoutesFromElements(
        <Route>
            <Route path="/login" element={<Login />} />
            <Route path="/" element={<Home />}>
                <Route index element={<HomePage />} />

                <Route path="homePage" element={<HomePage />}>
                    <Route path="cabout" element={<CAbout />} /> {/* CAbout 作为 homePage 的子界面 */}
                </Route>
                <Route path="contact" element={<Contact />} />
                <Route path="about" element={<About />} />
            </Route>
        </Route>
    )
)

export default router